<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <p>123</p>
  <script>
     try{
      //可能会报错的
      console.log(age);
     }catch(err){
      //捕获报错
      alert(err.message);
     }finally{
      console.log('你逃不出老娘的手掌心');
     }

  </script>
</body>

</html>